<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="m" uri="/connext" %>
<%@ taglib prefix="q" uri="/webframework-tags" %>
<%request.setAttribute("contextPath", request.getContextPath());%>
 <%
    response.setHeader("Pragma","No-cache");
    response.setHeader("Cache-Control","no-cache");
    response.setDateHeader("Expires", 0);
    response.flushBuffer();
    session.invalidate();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>login</title>
<link href="${contextPath}/style/form.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${contextPath}/js/prototype.js"></script>
<script type="text/javascript" src="${contextPath}/js/prototype-extension.js"></script>
<style>
html {font-size:100.01%;}
body{ background:url(${contextPath }/images/login_bg.jpg) no-repeat center top; background-color:#b5c9ea; text-align:center;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
.login{ width:400px; margin:0 auto; padding:300px 0 0 100px; text-align:left; font-size:12px;}
</style>
</head>

<body>
<div class="login">
<form id="loginForm" name="loginForm" action="${contextPath}/skip/auth.action"  method="post">
    <table border="0">
      <tr>
        <td><img src="${contextPath }/images/user.png" alt="username" width="30" height="30" align="absmiddle" />&nbsp;User name</td>
        <td width="18"><input type="text" name="name" id="name" size="18" tabindex="1" /></td>
        <td width="100" rowspan="3" align="center">
        	<a href="javascript:login();"><img src="${contextPath }/images/sign_in.png" alt="login" width="56" height="105"  style="margin-top:10px" align="absmiddle" border="0" /></a></td>
      </tr>
      <tr>
        <td><img src="${contextPath }/images/password.png" width="30" height="30" align="absmiddle" />&nbsp;Password</td>
        <td><input type="password" name="passwd" id="passwd" size="19" tabindex="2" /></td>
        <td></td>
      </tr>
    </table>
</form>    
</div>

<script type="text/javascript">

 function login() {
	if ($('name').value.strip() == '') {
		alert('请输入用户名');
		$('name').focus();
		return;
	}
	var pattern_cn = /^([_\a-zA-Z0-9])*$/gi;
	if(!pattern_cn.test($('name').value.strip())){
		alert("用户名无效!");
		return;
	}
	var pattern_len_usr = /^[_\a-zA-Z0-9]{4,15}$/;
	if(!pattern_len_usr.test($('name').value.strip())){
		alert("用户名长度为4至15位");
		return;
	}
	if ($('passwd').value.strip() == '') {
		alert('请输入密码');
		$('passwd').focus();
		return;
	}
	var pattern_len_pwd = /^[_\a-zA-Z0-9]{4,15}$/;
	if(!pattern_len_pwd.test($('passwd').value.strip())){
		alert("密码长度为4至15位");
		return;
	}
	$('loginForm').submit();
 }

	$('loginForm').observe('keypress', function(event){
		if (event.keyCode == 13) {
			login();
		};
	});
			

</script>
</body>
</html>